import AirConditioning from '../container/Devices/AirConditioning';
import TopLight from '../container/Devices/TopLight';
import ClothCurtain from '../container/Devices/ClothCurtain';
import AirSystem from '../container/Devices/AirSystem';
import SoundsAndLightAlarm from '../container/Devices/SoundsAndLightAlarm';
import TempAndWetSensor from '../container/Devices/TempAndWetSensor';
import GasAlarm from '../container/Devices/GasAlarm';
import WaterControl from '../container/Devices/WaterControl';
import DoorMagnet from '../container/Devices/DoorMagnet';
import Sensor from '../container/Devices/Sensor';
import SmartSocket from '../container/Devices/SmartSocket';


export function modelToKeyString(model) {
  if (model === null){
    return '';
  }

  let key_string ='';
	if(model.indexOf("ARGRACE_LIVING_WALLSWITCH")>=0 && model.indexOf("_A")>=0){

		key_string ="Switch_1";
	}
	else if(model.indexOf("ARGRACE_LIVING_WALLSWITCH")>=0 && model.indexOf("_B")>=0){
		key_string ="Switch_2";
	}
	else if(model.indexOf("ARGRACE_LIVING_WALLSWITCH")>=0 && model.indexOf("_C")>=0){
		key_string ="Switch_3";
	}
	else if(model.indexOf("ARGRACE_LIVING_WALLSWITCH")>=0){
		key_string ="Switch";
	}
	return key_string;
}

export function modelToComponet(model) {
  if (model === null){
    return '';
  }
  let key_string ='';
  if(model.indexOf("ARGRACE_LIVING_AIRCONDITION_INFRA_RED_CTRL")>=0 ){

    return AirConditioning
  }
  else if(model.indexOf("ARGRACE_SECURITY_SIREN_HC_109ZB_SDS")>=0 ){

    return SoundsAndLightAlarm
  }
  else if(model.indexOf("ARGRACE_LIVING_FLOORHEATING_U86KWF3000_ZP")>=0 ){
    //地暖
    return WaterControl
  }
  else if(model.indexOf("ARGRACE_SECURITY_MAGNET_HO_09F_SDS")>=0 ){
    return DoorMagnet
  }
  //红外探测器
  else if(model.indexOf("ARGRACE_SECURITY_IRDETECTOR_U86CGQ_ZHY_SDS")>=0 ){
    return Sensor
  }
  else if(model.indexOf("ARGRACE_SECURITY_SMOKE_LH_99F_SDS")>=0 ){
    return GasAlarm
  }
  else if(model.indexOf('ARGRACE_LIVING_AIRBOX_PMT100_SDS')>=0){
    return TempAndWetSensor
  }
  else if(model.indexOf("ARGRACE_LIVING_WALLSWITCH")>=0){
    return TopLight
  }
  else if(model.indexOf("ARGRACE_LIVING_CURTAIN_IHW1213_SDS")>=0){
    return ClothCurtain
  }
  else if(model.indexOf("ARGRACE_LIVING_FAU_U86KF_ZP_SDS")>=0){
    return AirSystem
  }
  else if(model.indexOf("ARGRACE_LIVING_OUTLET_U86Z223A10_ZJU_SDS")>=0){
    return SmartSocket
  }
  return '';
}
